﻿@model sBlog.Net.Areas.Admin.Models.AdminSocialSharingOptions

@{
    ViewBag.Title = string.Format("Social Sharing Options || {0}", Model.Title);
}

@Html.Partial("UpdateStatus", Model.UpdateStatus)

@if (Model.IsEnabled)
{
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">Social Sharing Settings</h3>
        </div>
        <div class="panel-body">
            @using (Html.BeginForm())
            {
                foreach (var shareable in Model.Options)
                {
                    var id = string.Format("radio{0}", shareable.Value);

                    if (shareable.Selected)
                    {
                        <input type="radio" value="@shareable.Value" id="@id" name="@Model.Name" checked="checked" />
                    }
                    else
                    {
                        <input type="radio" value="@shareable.Value" id="@id" name="@Model.Name" />
                    }
                    <span><img src="@Url.Content(shareable.ImageUrl)" alt="" class="@Model.ImageClass" /></span>
                    <br />
                }
                <br />
                <p class="pull-right">
                    <input type="submit" value="Update Settings" class="btn btn-lg btn-primary" />
                </p>
            }
        </div>
    </div>
}
else
{
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">Social Sharing Settings</h3>
        </div>
        <div class="panel-body">
            @using(Html.BeginForm("EnableSocialSharing","Admin"))
            {
                @Html.CheckBox("enableSocialSharing", new { @id = "enableSocialSharing" })
                <label for="enableSocialSharing">Enable Social Sharing</label>
                <input type="submit" value="Enable"  class="btn btn-lg btn-primary" />
            }
        </div>
    </div>    
}
